package com.itheima.a01mystream;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Consumer;

public class StreamDemo2 {
    public static void main(String[] args) {
        /**
         * Stream流的获取方法有四种
         * 单列集合获取Stream流
         */

        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "a", "b", "c", "d", "e");

        // list.stream().forEach(new Consumer<String>() {
        //     @Override
        //     public void accept(String s) {
        //         System.out.println(s);
        //     }
        // });

        list.stream().forEach(s -> System.out.println(s));
    }
}
